package com.fr.chicken.manager.recharge;

import com.fr.chicken.dao.RechargeLogDao;
import com.fr.chicken.model.RechargeLog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class RechargeManager {
    @Autowired
    private RechargeLogDao rechargeLogDao;

    /**
     * 添加一个充值记录
     * */
    public boolean addRechargeLog(long playerId,int goodsId,String orderNum,int stat){
       return rechargeLogDao.insertSelective(createRechargeLog(playerId, goodsId, orderNum, stat)) > 0 ;
    }

    public RechargeLog createRechargeLog(long playerId, int goodsId, String orderNum, int stat) {
        RechargeLog log = new RechargeLog();
        log.setPlayerId(playerId);
        log.setGoodsId(goodsId);
        log.setOrderNum(orderNum);
        log.setStat(stat);
        return log;
    }
}
